import time
import unittest
import app
from script.test01_login import Testlogin
from script.test03_employee import TestEmployee
from tools.HTMLTestRunner import HTMLTestRunner

suite = unittest.TestSuite()
# 登录接口测试用例
suite.addTest(unittest.makeSuite(Testlogin))
# 员工管理场景测试用例
suite.addTest(Testlogin("test01_login_success"))
suite.addTest(unittest.makeSuite(TestEmployee))


# report = app.BASE_DIR + '/report/report-{}.html'.format(time.strftime("%Y%m%d-%H%M%S"))
report = app.BASE_DIR + '/report/report.html'

with open(report, "wb") as f:
    runner = HTMLTestRunner(f, title="IHRM接口测试报告")
    runner.run(suite)
